﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;

/// <summary>
/// Summary description for IRole
/// </summary>
public interface IRoles
{
    /// <summary>
    /// Get all Roles
    /// </summary>
    /// <returns>Return object DataTable stores list roles</returns>
    List<Roles> GetAllRoles();

    /// <summary>
    /// Get Role by idRole
    /// </summary>
    /// <param name="idRole">Id of Role</param>
    /// <returns>Return Role</returns>
    Roles GetRoleById(int idRole);

    /// <summary>
    /// Create Role
    /// </summary>
    /// <param name="RoleName">Name of Role</param>
    /// <returns>Return result was created. If created then return 1, else return 0</returns>
    bool CreateRole(string roleName);

    /// <summary>
    /// Update Role
    /// </summary>
    /// <param name="role">Role need to update</param>
    /// <returns>>Return result was updated. If success then return 1, else return 0</returns>
    bool UpdateRole(Roles role);

    /// <summary>
    /// Delete Role
    /// </summary>
    /// <param name="idRole">Id of Role need to delete</param>
    /// <returns>Return result was deleted. If deleted then return 1, else return 0</returns>
    bool DeletedRole(int idRole);

    /// <summary>
    /// Convert object DataRow to object Role
    /// </summary>
    /// <param name="dr">Object DataRow from DataTable</param>
    /// <returns>Return object Role was converted</returns>
    Roles ConvertDataRowToObjectRole(DataRow dr);
}